/*****************************************************************************
 *
 * Copyright (C) 2006 Atmel Corporation
 *
 ****************************************************************************/
#ifndef AVR32_DAC_101_H_INCLUDED
#define AVR32_DAC_101_H_INCLUDED

#include "avr32/abi.h"


/*
 Note to user:

 The following defines are always generated:
 - Register offset: AVR32_DAC_<register>
 - Bitfield mask:   AVR32_DAC_<register>_<bitfield>
 - Bitfield offset: AVR32_DAC_<register>_<bitfield>_OFFSET
 - Bitfield size:   AVR32_DAC_<register>_<bitfield>_SIZE
 - Bitfield values: AVR32_DAC_<register>_<bitfield>_<value name>

 The following defines are generated if they don't cause ambiguities,
 i.e. the name is unique, or all values with that name are the same.
 - Bitfield mask:   AVR32_DAC_<bitfield>
 - Bitfield offset: AVR32_DAC_<bitfield>_OFFSET
 - Bitfield size:   AVR32_DAC_<bitfield>_SIZE
 - Bitfield values: AVR32_DAC_<bitfield>_<value name>
 - Bitfield values: AVR32_DAC_<value name>

 All defines are sorted alphabetically.
*/


#define AVR32_DAC_CHANNEL0                                          0
#define AVR32_DAC_CHANNEL0_MASK                            0x0000ffff
#define AVR32_DAC_CHANNEL0_OFFSET                                   0
#define AVR32_DAC_CHANNEL0_SIZE                                    16
#define AVR32_DAC_CHANNEL1                                         16
#define AVR32_DAC_CHANNEL1_MASK                            0xffff0000
#define AVR32_DAC_CHANNEL1_OFFSET                                  16
#define AVR32_DAC_CHANNEL1_SIZE                                    16
#define AVR32_DAC_CR                                       0x00000008
#define AVR32_DAC_CR_EN                                            31
#define AVR32_DAC_CR_EN_MASK                               0x80000000
#define AVR32_DAC_CR_EN_OFFSET                                     31
#define AVR32_DAC_CR_EN_SIZE                                        1
#define AVR32_DAC_CR_SWAP                                          30
#define AVR32_DAC_CR_SWAP_MASK                             0x40000000
#define AVR32_DAC_CR_SWAP_OFFSET                                   30
#define AVR32_DAC_CR_SWAP_SIZE                                      1
#define AVR32_DAC_EN                                               31
#define AVR32_DAC_EN_MASK                                  0x80000000
#define AVR32_DAC_EN_OFFSET                                        31
#define AVR32_DAC_EN_SIZE                                           1
#define AVR32_DAC_ICR                                      0x00000018
#define AVR32_DAC_ICR_TX_READY                                     29
#define AVR32_DAC_ICR_TX_READY_MASK                        0x20000000
#define AVR32_DAC_ICR_TX_READY_OFFSET                              29
#define AVR32_DAC_ICR_TX_READY_SIZE                                 1
#define AVR32_DAC_ICR_UNDERRUN                                     28
#define AVR32_DAC_ICR_UNDERRUN_MASK                        0x10000000
#define AVR32_DAC_ICR_UNDERRUN_OFFSET                              28
#define AVR32_DAC_ICR_UNDERRUN_SIZE                                 1
#define AVR32_DAC_IDR                                      0x00000014
#define AVR32_DAC_IDR_TX_READY                                     29
#define AVR32_DAC_IDR_TX_READY_MASK                        0x20000000
#define AVR32_DAC_IDR_TX_READY_OFFSET                              29
#define AVR32_DAC_IDR_TX_READY_SIZE                                 1
#define AVR32_DAC_IDR_UNDERRUN                                     28
#define AVR32_DAC_IDR_UNDERRUN_MASK                        0x10000000
#define AVR32_DAC_IDR_UNDERRUN_OFFSET                              28
#define AVR32_DAC_IDR_UNDERRUN_SIZE                                 1
#define AVR32_DAC_IER                                      0x00000010
#define AVR32_DAC_IER_TX_READY                                     29
#define AVR32_DAC_IER_TX_READY_MASK                        0x20000000
#define AVR32_DAC_IER_TX_READY_OFFSET                              29
#define AVR32_DAC_IER_TX_READY_SIZE                                 1
#define AVR32_DAC_IER_UNDERRUN                                     28
#define AVR32_DAC_IER_UNDERRUN_MASK                        0x10000000
#define AVR32_DAC_IER_UNDERRUN_OFFSET                              28
#define AVR32_DAC_IER_UNDERRUN_SIZE                                 1
#define AVR32_DAC_IMR                                      0x0000000c
#define AVR32_DAC_IMR_TX_READY                                     29
#define AVR32_DAC_IMR_TX_READY_MASK                        0x20000000
#define AVR32_DAC_IMR_TX_READY_OFFSET                              29
#define AVR32_DAC_IMR_TX_READY_SIZE                                 1
#define AVR32_DAC_IMR_UNDERRUN                                     28
#define AVR32_DAC_IMR_UNDERRUN_MASK                        0x10000000
#define AVR32_DAC_IMR_UNDERRUN_OFFSET                              28
#define AVR32_DAC_IMR_UNDERRUN_SIZE                                 1
#define AVR32_DAC_ISR                                      0x0000001c
#define AVR32_DAC_ISR_TX_READY                                     29
#define AVR32_DAC_ISR_TX_READY_MASK                        0x20000000
#define AVR32_DAC_ISR_TX_READY_OFFSET                              29
#define AVR32_DAC_ISR_TX_READY_SIZE                                 1
#define AVR32_DAC_ISR_UNDERRUN                                     28
#define AVR32_DAC_ISR_UNDERRUN_MASK                        0x10000000
#define AVR32_DAC_ISR_UNDERRUN_OFFSET                              28
#define AVR32_DAC_ISR_UNDERRUN_SIZE                                 1
#define AVR32_DAC_SDR                                      0x00000000
#define AVR32_DAC_SDR_CHANNEL0                                      0
#define AVR32_DAC_SDR_CHANNEL0_MASK                        0x0000ffff
#define AVR32_DAC_SDR_CHANNEL0_OFFSET                               0
#define AVR32_DAC_SDR_CHANNEL0_SIZE                                16
#define AVR32_DAC_SDR_CHANNEL1                                     16
#define AVR32_DAC_SDR_CHANNEL1_MASK                        0xffff0000
#define AVR32_DAC_SDR_CHANNEL1_OFFSET                              16
#define AVR32_DAC_SDR_CHANNEL1_SIZE                                16
#define AVR32_DAC_SWAP                                             30
#define AVR32_DAC_SWAP_MASK                                0x40000000
#define AVR32_DAC_SWAP_OFFSET                                      30
#define AVR32_DAC_SWAP_SIZE                                         1
#define AVR32_DAC_TX_READY                                         29
#define AVR32_DAC_TX_READY_MASK                            0x20000000
#define AVR32_DAC_TX_READY_OFFSET                                  29
#define AVR32_DAC_TX_READY_SIZE                                     1
#define AVR32_DAC_UNDERRUN                                         28
#define AVR32_DAC_UNDERRUN_MASK                            0x10000000
#define AVR32_DAC_UNDERRUN_OFFSET                                  28
#define AVR32_DAC_UNDERRUN_SIZE                                     1




#ifdef __AVR32_ABI_COMPILER__


typedef struct avr32_dac_sdr_t {
    unsigned int channel1        :16;
    unsigned int channel0        :16;
} avr32_dac_sdr_t;



typedef struct avr32_dac_cr_t {
    unsigned int en              : 1;
    unsigned int swap            : 1;
    unsigned int                 :30;
} avr32_dac_cr_t;



typedef struct avr32_dac_imr_t {
    unsigned int                 : 2;
    unsigned int tx_ready        : 1;
    unsigned int underrun        : 1;
    unsigned int                 :28;
} avr32_dac_imr_t;



typedef struct avr32_dac_ier_t {
    unsigned int                 : 2;
    unsigned int tx_ready        : 1;
    unsigned int underrun        : 1;
    unsigned int                 :28;
} avr32_dac_ier_t;



typedef struct avr32_dac_idr_t {
    unsigned int                 : 2;
    unsigned int tx_ready        : 1;
    unsigned int underrun        : 1;
    unsigned int                 :28;
} avr32_dac_idr_t;



typedef struct avr32_dac_icr_t {
    unsigned int                 : 2;
    unsigned int tx_ready        : 1;
    unsigned int underrun        : 1;
    unsigned int                 :28;
} avr32_dac_icr_t;



typedef struct avr32_dac_isr_t {
    unsigned int                 : 2;
    unsigned int tx_ready        : 1;
    unsigned int underrun        : 1;
    unsigned int                 :28;
} avr32_dac_isr_t;



typedef struct avr32_dac_t {
  union {
          unsigned long                  sdr       ;//0x0000
          avr32_dac_sdr_t                SDR       ;
  };
          unsigned int                   :32       ;//0x0004
  union {
          unsigned long                  cr        ;//0x0008
          avr32_dac_cr_t                 CR        ;
  };
  union {
    const unsigned long                  imr       ;//0x000c
    const avr32_dac_imr_t                IMR       ;
  };
  union {
          unsigned long                  ier       ;//0x0010
          avr32_dac_ier_t                IER       ;
  };
  union {
          unsigned long                  idr       ;//0x0014
          avr32_dac_idr_t                IDR       ;
  };
  union {
          unsigned long                  icr       ;//0x0018
          avr32_dac_icr_t                ICR       ;
  };
  union {
    const unsigned long                  isr       ;//0x001c
    const avr32_dac_isr_t                ISR       ;
  };
} avr32_dac_t;



/*#ifdef __AVR32_ABI_COMPILER__*/
#endif

/*#ifdef AVR32_DAC_101_H_INCLUDED*/
#endif

